//
//  RCOAuthControllerViewController.m
//  RCsinaMicroBlog
//
//  Created by Mr.Ray on 15/2/3.
//  Copyright (c) 2015年 Ray.peng. All rights reserved.
//

#import "RCOAuthController.h"

#define App_Key @"1868663254"
#define App_Secret @"b54b12da95e7bfdc3cc81716f3d74c05"
#define RCAuthorizeUrl @"https://api.weibo.com/oauth2/authorize"
#define RCRedirectUri @"http://www.youthob.cn"

@interface RCOAuthController ()

@end

@implementation RCOAuthController

- (void)loadView{
    self.view = [[UIWebView alloc]init];
}


- (void)viewDidLoad {
    [super viewDidLoad];
    
    [self loadWebView];
    self.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc]initWithTitle:@"取消" style:UIBarButtonItemStylePlain target:self action:@selector(close)];
}
- (void)close{
    [self dismissViewControllerAnimated:YES completion:nil];
}

- (void)loadWebView{
    NSString *urlStr = [NSString stringWithFormat:@"%@?client_id=%@&redirect_uri=%@", RCAuthorizeUrl, App_Key, RCRedirectUri];
    NSURL *url = [NSURL URLWithString:urlStr];
    NSURLRequest *request = [NSURLRequest requestWithURL:url];
    
    UIWebView *webView = (UIWebView *)self.view;
    [webView loadRequest:request];
    
}





@end
